<template>
  <el-card class="info-card" shadow="hover">
    <div class="card-content">
      <div class="icon-wrapper" :style="{ backgroundColor: color }">
        <el-icon :size="24"><component :is="icon" /></el-icon>
      </div>
      <div class="text-content">
        <div class="title">{{ title }}</div>
        <div class="value">{{ value }}</div>
      </div>
    </div>
  </el-card>
</template>

<script setup>
defineProps({
  title: {
    type: String,
    required: true
  },
  value: {
    type: String,
    required: true
  },
  icon: {
    type: String,
    required: true
  },
  color: {
    type: String,
    default: '#409EFF'
  }
})
</script>

<style scoped>
.info-card {
  border: none;
  border-radius: 8px;
  transition: transform 0.3s;
}

.info-card:hover {
  transform: translateY(-5px);
}

.card-content {
  display: flex;
  align-items: center;
  padding: 15px 0;
}

.icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  margin-right: 15px;
}

.text-content {
  flex: 1;
}

.title {
  font-size: 14px;
  color: #909399;
  margin-bottom: 5px;
}

.value {
  font-size: 24px;
  font-weight: bold;
  color: #303133;
}
</style>